var i;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var ResKeeper = require("AA_ResKeeper");
var CommonUtils = require("AA_CommonUtils");
var Item_GameEquip = require("AA_Item_GameEquip");
var _decorator = cc._decorator;
var _ccclass = _decorator.ccclass;
var _property = _decorator.property;
_decorator.inspector;
var _def_UpLevel5LineTip = function (e) {
  function _creator() {
    var t = null !== e && e.apply(this, arguments) || this;
    t.dianNode = null;
    t.ziNode = null;
    t.quanNode = null;
    return t;
  }
  __extends(_creator, e);
  _creator.prototype.onLoad = function () {
    this.quanNode.runAction(cc.repeatForever(cc.rotateBy(3, 360)));
  };
  _creator.prototype.StartSet = function (e, t, o) {
    this.nodeA = e;
    this.nodeB = t;
    this.takeBackThis = o;
    this.node.active = true;
    this.ResetThis();
  };
  _creator.prototype.ResetThis = function () {
    var e = this;
    this.scheduleOnce(function () {
      if (e.nodeA && e.nodeA.isValid && e.nodeB && e.nodeB.isValid) {
        var t = e.nodeA.convertToWorldSpaceAR(cc.v2(0, 0));
        var o = e.nodeB.convertToWorldSpaceAR(cc.v2(0, 0));
        e.node.setPosition(e.node.parent.convertToNodeSpaceAR(t));
        var n = cc.Vec2.distance(t, o) / 200;
        e.dianNode.scaleX = n;
        e.dianNode.scaleY = 3;
        var i = cc.v2(t.x + (o.x - t.x) / 2, t.y + (o.y - t.y) / 2);
        e.ziNode.setPosition(e.node.convertToNodeSpaceAR(i));
        e.dianNode.angle = CommonUtils.default.getPointAngle(t, o);
        var a = e.nodeA.getComponent(Item_GameEquip.default);
        a && a.ShowKuangTip(true);
        var r = e.nodeB.getComponent(Item_GameEquip.default);
        r && r.ShowKuangTip(true);
      } else {
        e.takeBackThis && e.takeBackThis(e.node);
      }
    });
  };
  __decorate([_property(cc.Node)], _creator.prototype, "dianNode", undefined);
  __decorate([_property(cc.Node)], _creator.prototype, "ziNode", undefined);
  __decorate([_property(cc.Node)], _creator.prototype, "quanNode", undefined);
  return __decorate([_ccclass], _creator);
}(ResKeeper.default);
exports.default = _def_UpLevel5LineTip;